package cn.edu.ctbu.finaltest.service.StudentSelectCourseService.impl;


import cn.edu.ctbu.finaltest.service.StudentSelectCourseService.StudentSelectCourseService;
import cn.edu.ctbu.finaltest.vo.StudentSelectCourse;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class StudentSelectCourseImplService implements StudentSelectCourseService {

    /**
     * 课号精确查找
     * @param cno
     * @param SSCList
     * @return
     */
    public List<StudentSelectCourse> findByCno(String cno, List<StudentSelectCourse> SSCList){
        List<StudentSelectCourse> studentSelectCourses = new ArrayList<>();
        for (int i = 0;i < SSCList.size();i++){
            if (SSCList.get(i).getCno().equals(cno)){
                studentSelectCourses.add(SSCList.get(i));
            }
        }
        return studentSelectCourses;
    }


}
